<%@page import="java.math.BigDecimal"%>
<%@page import="java.util.Collection"%>
<%@page import="empentity.EmpComponent"%>
<%@page import="javax.naming.InitialContext"%>
<%@page import="empsession.EmpSessionComponent, empsession.EmpSessionHome" contentType="text/html" pageEncoding="UTF-8"%>
<%!    private EmpSessionComponent empSession = null;
    private String ejbsessionname = "ejb/EmpSessionBean";
//private Integer empno = null;
    public void jspInit() {
        try {
            InitialContext context = new InitialContext();
            EmpSessionHome empSessionHome = (EmpSessionHome) context.lookup(ejbsessionname);
            empSession = empSessionHome.create();
            //empSession.createEmp(new BigDecimal(7905), "ename", "job", null, new java.sql.Date(new java.util.Date().getTime()), new BigDecimal(1000), null, null);
//        empSession.deleteEmp(new BigDecimal(7904));
            //    BigDecimal empno = ((EmpComponent)empSession.getEmpByJob("job").iterator().next()).getEmpno();
            //    empSession.createDept(new BigDecimal(60), "dname", "loc");
            //  empSession.deleteDept(new BigDecimal(50));
        } catch (Exception ex) {
            ex.printStackTrace();
        }

    }%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <div>hELLO<%=((EmpComponent) empSession.getEmpByJob("job").iterator().next()).getEmpno()%></div>
    </body>
</html>
